#pragma once
#include <iostream>

template <typename T>
class MyVector
{
        friend std::ostream& operator<<(std::ostream &out, const MyVector<T> &obj){
                for (int i = 0; i < obj.m_len; i++)
                {
                        out<<obj.m_space[i]<< " ";
                }
                out<<std::endl;
                return out;       
        };

public:
        MyVector(int size = 0); //构造函数
        MyVector(const MyVector &obj); //拷贝构造函数

        ~MyVector(); //析够函数
public:
        T& operator[](int index);
        MyVector& operator=(const MyVector &obj);
public:
        int getLen(){
                return m_len;
        }
protected:
        T *m_space;
        int m_len;
};


